package com.heima.user.controller;

import com.heima.model.admin.dtos.UserAuthDto;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.user.pojos.ApUser;
import com.heima.user.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description TODO
 * @Author earl
 * @Data 2024/8/21下午3:53
 * @Version 1.0
 */
@Slf4j
@RestController
@RequestMapping("/api/v1")
public class UserController {
    @Autowired
    UserService userService;


    @PostMapping("/user/user_follow")
    public ResponseResult userFollow(){
        return  userService.userFollow();
    }

    @PostMapping("/auth/list")
    ResponseResult getList(@RequestBody UserAuthDto userAuthDto){
        log.info("feign请求已收到");
        return userService.getList(userAuthDto);
    }

    /**
     * 审核失败
     *
     * @param userAuthDto
     * @return
     */
    @PostMapping("/auth/authFail")
    ResponseResult authFail(@RequestBody UserAuthDto userAuthDto) {
        return userService.authFail(userAuthDto);
    }

    /**
     * 审核成功
     * @param userAuthDto
     * @return
     */
    @PostMapping("/auth/authPass")
    ResponseResult authPass(@RequestBody UserAuthDto userAuthDto) {
        return userService.authPass(userAuthDto);
    }

}